<?php
ini_set('display_errors','1'); ini_set('display_startup_errors','1');  
include_once(ROOT_PATH."classes/dao/imgproducts.class.php");
$imgproducts = new imgProducts();
$templateFile = "khuyenmai.tpl.html";
$page = $request->element('page',1);
$slug = $request->element('slug','');
if($slug=="khuyen-mai-giam-gia"){
	$khuyenmaiItems= $imgproducts->getObjects($page,"status=1",array('id'=>'DESC'),12);
	 $template->assign('khuyenmaiItems',$khuyenmaiItems);
	 # Generate and pass link pager to template
	 $pages = $imgproducts->getNumItems('id',"status=1",12);
	$rows = $pages['rows'];
	$pages = $pages['pages'];
	if($page > $pages) $page = $pages;	
	if(URL_TYPE==1)
		$listPage = linkPager1_en(ROOTPATH."/index.php?op=khuyenmai&amp;lang=$lang&amp;&amp;slug=$slug&amp;page=%s",$pages,$page);
	else
		$listPage = linkPager1_en(ROOTPATH."/khuyen-mai-giam-gia/page-%s.html",$pages,$page);
	$template->assign("pager",$listPage);
	$template->assign("pages",$pages);
	$template->assign("rows",$rows);
}

#dung chung
include_once(ROOT_PATH."modules/framework.module.php");
# active
$pageName="Khuyến mãi giảm giá";
 $active='san-pham';
 $template->assign('active',$active);
  $template->assign('pageName',$pageName);
?>